<?php $this->load->view(TEMPLATE_NAME.'/front/header');?>
<?php $this->load->view(TEMPLATE_NAME.'/admin/side_left');?>
<script type="text/javascript" src="http://www.google.com/jsapi?key=<?php echo GOOGLE_MAPS_API_KEY ?>"></script>
<script type="text/javascript">    
    google.load("maps", "2.x");
    google.load("search", "1");
</script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.2.js"></script>

<style type="text/css">
.styletext{
    text-shadow: 0 0 0.2em #F87, 0 0 0.2em #F87;
    font-weight:bolder;
}
</style>
<script type="text/javascript" src="<?php echo $this->config->item('base_url')?>js/elabel.js"></script>
<script type="text/javascript">
    var map = null;
    var theListarea = '';
    var options = {};
    var lineCounter_ = 0;
    var colorIndex_ = 0;        
    var COLORS = [["orange", "#ff8800"]];
    var geocoder = null;
    
    $(document).ready(function(){
        map = new GMap2($("#map").get(0));
        <?$latlon = explode('#',$network['path']);?>
        var startMaps = new GLatLng<?php echo $latlon[0]?>;
        map.setCenter(startMaps, 13);
        map.setZoom(15);
        map.disableDoubleClickZoom();
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        geocoder = new GClientGeocoder(); 
        <?php           
                $path = '[new GLatLng'.str_replace('#',', new GLatLng',$network['path']).']';
                ?>                
                var polyData = <?php echo $path?>; 
                var polygon = new GPolygon(polyData, '#ff8800', 2, 0.4, "#00000",0.1     );
                  map.addOverlay(polygon);
                GEvent.addListener(polygon, "mouseover", function(latlng, index) {
                    polygon.setFillStyle({color: '#008000', weight: 2,opacity:0.5});
                });
                GEvent.addListener(polygon, "mouseout", function(latlng, index) {
                    polygon.setFillStyle({color: '#00000', weight: 0.7,opacity:0.1});
                });
                //alert(polygon.getBounds().getCenter());
                var label = new ELabel(polygon.getBounds().getCenter(), '<?php echo $network['name']?>', "styletext");
                map.addOverlay(label);            
        }); 
</script>
<div class="page noright adminpage adminuser">
    <h2>Network <?php echo $network['name']?></h2>
    <div id="map" style="width:590px;height:400px"></div>
    <?php echo form_open('admin/profile/join_network',array('method' => 'post', 'class' => 'formstep'));?>
        <input type="hidden" name="network_id" value="<?php echo $network_id?>">
        <?foreach($user_network as $network_collection => $value){
            if($network_id == $value['id_network']){
                $match = 1;
            }
        }
        if(!$match){?>
        <button>Join Network</button>
        <?}else{?>
        Your already member of this network
        <?}?>
    </form>
    <a href="<?php echo site_url('manage_network/about/'.$network_id); ?>">Manage this network</a>
<div class="clear"></div>
    <?php $this->load->view(TEMPLATE_NAME.'/front/footer_menu');?>
</div><!-- page -->

<?php $this->load->view(TEMPLATE_NAME.'/front/side_right');?> 
